#ifndef VBOVOXEL_H
#define VBOVOXEL_H
#include "includes.h"

typedef struct _vboVoxel{
    vertex v[8];

    _vboVoxel(){
        v[0].nx=-1;
        v[0].ny=-1;
        v[0].nz=-1;

        v[1].nx=-1;
        v[1].ny=-1;
        v[1].nz=1;

        v[2].nx=-1;
        v[2].ny=1;
        v[2].nz=-1;

        v[3].nx=-1;
        v[3].ny=1;
        v[3].nz=1;

        v[4].nx=1;
        v[4].ny=-1;
        v[4].nz=-1;

        v[5].nx=1;
        v[5].ny=-1;
        v[5].nz=1;

        v[6].nx=1;
        v[6].ny=1;
        v[6].nz=-1;

        v[7].nx=1;
        v[7].ny=1;
        v[7].nz=1;

    }

    void setCoords(short x, short y, short z){
        short xplus = x+VOXEL_SIZE,
              yplus = y+VOXEL_SIZE,
              zplus = z+VOXEL_SIZE;
        v[0].x=x;
        v[0].y=y;
        v[0].z=z;

        v[1].x=x;
        v[1].y=y;
        v[1].z=zplus;

        v[2].x=x;
        v[2].y=yplus;
        v[2].z=z;

        v[3].x=x;
        v[3].y=yplus;
        v[3].z=zplus;

        v[4].x=xplus;
        v[4].y=y;
        v[4].z=z;

        v[5].x=xplus;
        v[5].y=y;
        v[5].z=zplus;

        v[6].x=xplus;
        v[6].y=yplus;
        v[6].z=z;

        v[7].x=xplus;
        v[7].y=yplus;
        v[7].z=zplus;
    }

    void setColor(colour& col){
        v[0].c=col;
        v[1].c=col;
        v[2].c=col;
        v[3].c=col;
        v[4].c=col;
        v[5].c=col;
        v[6].c=col;
        v[7].c=col;
    }
}vboVoxel;

#endif // VBOVOXEL_H
